package edu.fit5046.mymonashmate.utils;

import org.json.JSONException;
import org.json.JSONObject;

public class SimpleInfo {
	public int ID;
	public double latitude;
	public double longitude;
	public String Name;
	public String course;
	public int matching_score=0;
	public static int localId;
	
	public SimpleInfo(){
		
		
	}

	public SimpleInfo(int id, double latitude, double longitude, String name,
			String course, int matching_score) {
		this.ID = id;
		this.latitude = latitude;
		this.longitude = longitude;
		this.Name = name;
		this.course = course;
		this.matching_score = matching_score;
	}
	public SimpleInfo(String json) throws JSONException {
		JSONObject js = new JSONObject(json);
		this.ID = js.getInt("stuId");
		// cannot be null
		this.Name = js.getString("givenname");
		this.Name += " ";
		this.Name += js.getString("surname");
		// location
		this.latitude = js.getDouble("latitude");
		this.longitude = js.getDouble("longitude");}

}
